import { getSecklist } from '@/request/miaosha'
export default {
    namespaced: true,
    state: {
        seckill: [],//分类信息 列表
        //单个分类信息
        // cateinfo: {
        //     pid: 0, //上级分类编号    0 顶级菜单(目录)
        //     catename: "", //分类名称
        //     img: "", //图片
        //     status: 1, //状态1正常2禁用
        // },
    },
    getters: {
        Seckill: state => state.seckill,
        // cateInfo: state => state.cateinfo
    },
    mutations: {
        SET_MIAOSHA(state, data) {
            state.seckill = data
        },
        // SET_CATEINFO(state, data) {
        //     state.cateinfo = data
        // },
    },
    actions: {
        //获取所有分类信息
        async setSecklist({ commit }) {
            let { list } = await getSecklist()
            commit("SET_MIAOSHA", list);
        },
        // async getCateListById({ commit }, id) {
        //     let { list } = await getCateList(id)
        //     commit("SET_CATEINFO", list);
        // },
    }
}